import React, { Suspense }   from 'react';
import { NavLink, useRoutes } from 'react-router-dom';
import Loading from './page/Loading';
 
// import About from './page/About';
import routes from "./routes"

export default function App() {
	// 注册路由
	const element = useRoutes(routes)

	return (
		<div>
			<div>
				<NavLink to={'/home'}>导航到home</NavLink>
				<br />
				<NavLink to={'/about'}>导航到about</NavLink>
			</div>
				{/* 注册路由 */}
				<Suspense fallback={<Loading/>}>
					{element}
				</Suspense>
		</div>
	);
}
